<?php
	$id=$_GET['id'];
	
	$conn=mysqli_connect('localhost','root','root','mydate');
	//设置链接过程中存取数据的编码
	mysqli_query($conn,"set charset 'utf8'");
	mysqli_query($conn,"set character set 'utf8'");
	
	// 四、删除数据
	// 2.编写sql语句
	$sql="delete from shop2 where id=$id";
	// 3.执行sql语句
	// 现在res得到的结果是一个布尔值
	$res=mysqli_query($conn,$sql);
	if($res){
		echo json_encode(array(
			"code" => 200,
			"body" => array(
				"msg" => "删除成功"
			)
		));
	}else{
		echo json_encode(array(
			"code" => 201,
			"body" => array(
				"msg" => "添加失败"
			)
		));
	};
	
	
	
?>